/*********************************************************
          File Name:10.13.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Tue 15 Sep 2015 03:25:58 PM CST
**********************************************************/

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using std::vector; using std::string; using std::partition;
using std::cout; using std::endl;

bool predicate(string &s)
{
        return (s.size() > 5 ? true : false);
}

int main()
{
        vector<string> vs{"this", "is", "a", "boring", "test", "right?"};

        auto it = partition(vs.begin(), vs.end(), predicate);

        for(auto iter = vs.begin(); iter != it; ++iter)
                cout << *iter << endl;

        return 0;
}
